<div class="timeline">
  <table class="timeline-content table">
    <thead>
    <tr>
      <% unless @project %>
        <th>Project</th>
      <% end %>
      <th>Started</th>
      <th>
        Duration
        <%= link_to_chart "#{@project&.name || @stage&.name} Deploy duration", @deploys.map(&:duration) %>
      </th>
      <th>Deploy</th>
      <% unless @stage %>
        <th>Stage</th>
      <% end %>
      <th>Status</th>
    </tr>
    </thead>
    <tbody>
    <%= render partial: "deploys/deploy", collection: @deploys %>
    </tbody>
  </table>
  <%= paginate @deploys if @deploys.respond_to?(:total_pages) %>
</div>
